From: Tim Deegan Date: Thu, 7 Apr 2011 10:39:35 +0000 (+0100) Subject: x86/hvm: do actually init nested HVM state for VCPUs X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/?a=commitdiff_plain;h=fd6ee4bb06ec232346892cc805730e939d710e62;p=xen.git x86/hvm: do actually init nested HVM state for VCPUs when nested HVM is enabled after VCPus are allocated. The previous patch would fail because the call to nestedhvm_vcpu_initialise() in the HVM param set code happens before nestedhvm_enabled(v->domain) is true. Signed-off-by: Tim Deegan --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 669330fbda..1ae4df98f0 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -967,7 +967,8 @@ int hvm_vcpu_initialise(struct vcpu *v) if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 ) goto fail2; - if ( (rc = nestedhvm_vcpu_initialise(v)) < 0 ) + if ( nestedhvm_enabled(v->domain) + && (rc = nestedhvm_vcpu_initialise(v)) < 0 ) goto fail3; /* Create ioreq event channel. */ diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c index 298f34ae1b..ef9a867527 100644 --- a/xen/arch/x86/hvm/nestedhvm.c +++ b/xen/arch/x86/hvm/nestedhvm.c @@ -74,9 +74,6 @@ nestedhvm_vcpu_initialise(struct vcpu *v) { int rc; - if ( !nestedhvm_enabled(v->domain) ) - return 0; - if ( (rc = nhvm_vcpu_initialise(v)) ) { nhvm_vcpu_destroy(v);